package dj.model;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * SysRoles entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "sys_roles", catalog = "", uniqueConstraints = @UniqueConstraint(columnNames = "roleName"))
public class SysRoles implements java.io.Serializable {

	// Fields

	private String id;
	private String roleName;
	private Integer seq;
	private Set<SysRoleMembers> sysRoleMemberses = new HashSet<SysRoleMembers>(0);

	// Constructors

	/** default constructor */
	public SysRoles() {
	}

	/** minimal constructor */
	public SysRoles(String id, String roleName, Integer seq) {
		this.id = id;
		this.roleName = roleName;
		this.seq = seq;
	}

	/** full constructor */
	public SysRoles(String id, String roleName, Integer seq, Set<SysRoleMembers> sysRoleMemberses) {
		this.id = id;
		this.roleName = roleName;
		this.seq = seq;
		this.sysRoleMemberses = sysRoleMemberses;
	}

	// Property accessors
	@Id
	@Column(name = "id", unique = true, nullable = false, length = 36)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "roleName", unique = true, nullable = false, length = 50)
	public String getRoleName() {
		return this.roleName;
	}

	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}

	@Column(name = "seq", nullable = false)
	public Integer getSeq() {
		return this.seq;
	}

	public void setSeq(Integer seq) {
		this.seq = seq;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "sysRoles")
	public Set<SysRoleMembers> getSysRoleMemberses() {
		return this.sysRoleMemberses;
	}

	public void setSysRoleMemberses(Set<SysRoleMembers> sysRoleMemberses) {
		this.sysRoleMemberses = sysRoleMemberses;
	}

}